<div class="layui-fluid">
    <div class="layui-card">
      <div class="layui-card-body">
        <form class="layui-form" action="<?=url('nav/edit');?>">
            <input type="hidden" name="id" value="<?=$info['id']?>" />

            <div class="layui-form-item">
              <label class="layui-form-label">分类</label>
              <div class="layui-input-block">
                    <select name="cat_id" required lay-verify="required">
                        <option value="">请选择分类</option>
                        <?php foreach($cat as $k => $v):?>
                            <option value="<?=$v['id']?>" <?php if($v['id']==$info['cat_id']):?>selected=true<?php endif;?>><?=$v['cat_title']?></option>
                        <?php endforeach;?>
                    </select>
              </div>
            </div>

            <div class="layui-form-item">
              <label class="layui-form-label">标题</label>
              <div class="layui-input-block">
                <input type="text" name="title" value="<?=$info['title']?>" required lay-verify="required" placeholder="请输入标题" autocomplete="off" class="layui-input">
              </div>
            </div>

            <div class="layui-form-item">
              <label class="layui-form-label">链接</label>
              <div class="layui-input-block">
                <input type="text" name="url" value="<?=$info['url']?>" placeholder="请输入链接" autocomplete="off" class="layui-input">
              </div>
            </div>
            <div class="layui-form-item">
              <label class="layui-form-label">参数</label>
              <div class="layui-input-block">
                <input type="text" name="ext" value="<?=$info['ext']?>" placeholder="请输入参数" autocomplete="off" class="layui-input">
              </div>
            </div>
            <div class="layui-form-item">
              <label class="layui-form-label">封面图</label>
              <div class="layui-input-block">
                  <button type="button" class="layui-btn" id="myupimg">
                    <i class="layui-icon">&#xe67c;</i>上传图片
                  </button>
                  <input type="hidden" name="pic" value="<?=$info['pic']?>" />
                  <div style="display:inline-block;position:relative;">
                      <span style="position:absolute;right:-15px; top:-15px;cursor:pointer;color:#ccc;font-size:24px;<?php if(!$info['pic']):?>display:none;<?php endif;?>" id="closeimg">x</span>
                      <img id="pic" height=50 src="<?=$info['pic']?>" />
                  </div>
              </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">状态</label>
                <div class="layui-input-block">
                    <input type="radio" name="status" value="0" title="显示" <?php if($info['status'] == 0):?>checked<?php endif;?>>
                    <input type="radio" name="status" value="1" title="隐藏" <?php if($info['status'] == 1):?>checked<?php endif;?>>
                </div>
            </div>
            <div class="layui-form-item">
              <label class="layui-form-label">打开方式</label>
              <div class="layui-input-block">
                    <select name="link_type">
                        <option value="0">请选择</option>
                        <?php foreach(c('type.link_type') as $key => $v):?>
                          <option value="<?=$key?>" <?php if($key == $info['link_type']):?>selected<?php endif; ?> ><?=$v?></option>
                      <?php endforeach;?>
                    </select>
              </div>
            </div>
          <div class="layui-form-item">
            <div class="layui-input-block">
              <button class="layui-btn" lay-submit lay-filter="myform">立即提交</button>
              <button type="reset" class="layui-btn layui-btn-primary">重置</button>
            </div>
          </div>
        </form>
      </div>
    </div>
</div>
<script>
layui.use(['form'], function(){
  var $ = layui.$
  ,form = layui.form;
  form.render();

  var ue = UE.getEditor('container');
});
</script>
